﻿<phone:PhoneApplicationPage 
    xmlns:local="clr-namespace:MTGScore"
    local:TiltEffect.IsTiltEnabled="True"
    x:Class="MTGScore.MainPage"
    xmlns:c4fToolkit="clr-namespace:Coding4Fun.Phone.Controls.Toolkit;assembly=Coding4Fun.Phone.Controls.Toolkit"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="768" 
    d:DataContext="{d:DesignData SampleData/MainViewModelSampleData.xaml}"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="PortraitOrLandscape"  Orientation="Portrait"
    shell:SystemTray.IsVisible="True"
    xmlns:toolbox="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    Loaded="MainPage_Loaded" BackKeyPress="PhoneApplicationPage_BackKeyPress"
    >
    <!--LayoutRoot is the root grid where all page content is placed-->

    <Grid x:Name="LayoutRoot" Background="Transparent">

        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="100" />
        </Grid.RowDefinitions>
        <!--Pivot Control-->
        <controls:Pivot Title="{Binding Path=Strings.Title, Source={StaticResource LocalizedStrings }}" Name="PivotControl" SelectionChanged="PivotControl_SelectionChanged">

            <!--Pivot item one-->
            <controls:PivotItem Header="{Binding Path=Strings.Match, Source={StaticResource LocalizedStrings }}" Name="MatchPivot_Name">

                <!--Double line list with text wrapping-->


                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="70*" />
                        <RowDefinition Height="70*" />
                        <RowDefinition Height="60*" />
                        <RowDefinition Height="60*" />
                        <RowDefinition Height="60*" />
                        <RowDefinition Height="60*" />
                        <RowDefinition Height="60*" />

                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="160*"/>
                        <ColumnDefinition Width="80*"/>
                        <ColumnDefinition Width="80*" />
                        <ColumnDefinition Width="160*" />
                    </Grid.ColumnDefinitions>

                    <TextBox FontSize="24" HorizontalAlignment="Center" Name="Player1Name_TextArea" Text="{Binding Path=Strings.Player_1, Source={StaticResource LocalizedStrings }}" VerticalAlignment="Stretch" Width="160" TextAlignment="Center" Grid.Row="0" Grid.Column="0" GotFocus="EnableIsHitTestVisible" KeyDown="CloseKeyboard"/>
                    <TextBox FontSize="24" HorizontalAlignment="Center" Name="CenterName_TextArea" Text="{Binding Path=Strings.Infect, Source={StaticResource LocalizedStrings }}" VerticalAlignment="Stretch" Width="160" TextAlignment="Center" Grid.Column="1" Grid.ColumnSpan="2" LostFocus="CenterText_LostFocus" GotFocus="EnableIsHitTestVisible" KeyDown="CloseKeyboard"/>
                    <TextBox FontSize="24" HorizontalAlignment="Center" Name="Player2Name_TextArea" Text="{Binding Path=Strings.Player_2, Source={StaticResource LocalizedStrings }}" VerticalAlignment="Stretch" Width="160" TextAlignment="Center" Grid.Column="3" GotFocus="EnableIsHitTestVisible" Grid.ColumnSpan="1" Grid.RowSpan="1" KeyDown="CloseKeyboard"/>
                    <TextBox FontSize="24" HorizontalAlignment="Center" Name="My_Life" Text="20" VerticalAlignment="Stretch" Width="160" TextAlignment="Center" Grid.Row="1" Grid.Column="0" LostFocus="MyLife_LostFocus" GotFocus="EnableIsHitTestVisible" KeyDown="CloseKeyboard">
                        <TextBox.InputScope>
                            <InputScope>
                                <InputScopeName NameValue="TelephoneNumber"/>
                            </InputScope>
                        </TextBox.InputScope>
                    </TextBox>
                    <TextBox FontSize="24" HorizontalAlignment="Center" Name="My_Center_Area" Text="0" VerticalAlignment="Stretch" Width="80" TextAlignment="Center" Grid.Row="1" Grid.Column="1" LostFocus="MyCenter_LostFocus" GotFocus="EnableIsHitTestVisible" KeyDown="CloseKeyboard">
                        <TextBox.InputScope>
                            <InputScope>
                                <InputScopeName NameValue="TelephoneNumber"/>
                            </InputScope>
                        </TextBox.InputScope>
                    </TextBox>
                    <TextBox FontSize="24" HorizontalAlignment="Center" Name="Opponent_Life" Text="20" VerticalAlignment="Stretch" Width="160" TextAlignment="Center" Grid.Row="1" Grid.Column="3" LostFocus="OpponentLife_LostFocus"  GotFocus="EnableIsHitTestVisible" KeyDown="CloseKeyboard">
                        <TextBox.InputScope>
                            <InputScope>
                                <InputScopeName NameValue="TelephoneNumber"/>
                            </InputScope>
                        </TextBox.InputScope>
                    </TextBox>
                    <TextBox FontSize="24" HorizontalAlignment="Center"  Name="Opponent_Center_Area" Text="0" Width="80" VerticalAlignment="Stretch" TextAlignment="Center" Grid.Row="1" Grid.Column="2" LostFocus="OpponentCenter_LostFocus" GotFocus="EnableIsHitTestVisible" KeyDown="CloseKeyboard">
                        <TextBox.InputScope>
                            <InputScope>
                                <InputScopeName NameValue="TelephoneNumber"/>
                            </InputScope>
                        </TextBox.InputScope>
                    </TextBox>



                    <Button Content="+ 1" Height="103" Name="Add_My_Life"  Click="Add_My_Life_Click" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="160" Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="1" Grid.RowSpan="2"/>
                    <Button Content="+ 1" Height="103" Name="Add_Opponent_Life" Click="Add_Opponent_Life_Click" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="160" Grid.Row="2" Grid.Column="3" Grid.ColumnSpan="1" Grid.RowSpan="2" />
                    <Button Content="+1" Height="73" Name="Add_My_Center" Click="Add_My_Center_Click" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="80" Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="1" Grid.RowSpan="1" />
                    <Button Content="+1" Height="73" Name="Add_Opponent_Center" Click="Add_Opponent_Center_Click" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="80" Grid.Row="2" Grid.Column="2" Grid.ColumnSpan="1" Grid.RowSpan="1" />
                    <Button Content="- 1" Height="103" Name="Subtract_My_Life" Click="Subtrack_My_Life_Click" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="160" Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="1" Grid.RowSpan="2"  />
                    <Button Content="- 1" Height="103" Name="Subtrack_Opponent_Life" Click="Subtrack_Opponent_Life_Click" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="160" Grid.Row="4" Grid.Column="3" Grid.ColumnSpan="1" Grid.RowSpan="2"/>
                    <Button Content="-1" Height="73"  Name="Sub_My_Center" Click="Sub_My_Center_Click" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="80" Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="1" Grid.RowSpan="1" />
                    <Button Content="-1" Height="73" Name="Sub_Opponent_Center" Click="Sub_Opponent_Center_Click" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="80" Grid.Row="3" Grid.Column="2" Grid.ColumnSpan="1" Grid.RowSpan="1" />
                    <TextBlock Name="timer_area" Text="00:00:00" HorizontalAlignment="Stretch" FontSize="36"  VerticalAlignment="Stretch" Width="160" Grid.Row="4" Grid.ColumnSpan="4" Grid.RowSpan="2" TextAlignment="Center" Margin="150,18,146,57" />
                    <Button Content="{Binding Path=Strings.ClearGame, Source={StaticResource LocalizedStrings }}" Height="70" Name="Clear_Game" Click="Clear_Game_Click" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="230" Grid.Row="6" Grid.Column="0" Grid.ColumnSpan="2" Grid.RowSpan="1"/>
                    <Button Content="{Binding Path=Strings.DiceSimulation, Source={StaticResource LocalizedStrings }}" Height="70" Name="Open_Dice_Simulation" Click ="Open_Dice_Simulation_Click" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="230" Grid.Row="6" Grid.Column="2" Grid.ColumnSpan="2" Grid.RowSpan="1"/>

                    <Image Name="Play_Button" Source="Images\dark\play.png" Width="80" Grid.Column="1" Grid.ColumnSpan="1" Grid.Row="5"   MouseLeftButtonDown="Play_Button_MouseLeftButtonDown"/>
                    <Image Name="Pause_Button" Source="Images\dark\pause.png" Width="80" Grid.Column="1" Grid.ColumnSpan="1" Grid.Row="5" MouseLeftButtonDown="Pause_Button_MouseLeftButtonDown" Visibility="Collapsed" />

                    <Image Name="Stop_Button" Source="Images\dark\stop.png" Width="80" Grid.Column="2" Grid.ColumnSpan="1" Grid.Row="5" MouseLeftButtonDown="Stop_Button_MouseLeftButtonDown" Visibility="Collapsed" />
                    <!--<Image Name="Restart_Button" Source="Images\dark\restart.png" Width="80" Grid.Column="2" Grid.ColumnSpan="1" Grid.Row="5" MouseLeftButtonDown="Restart_Button_MouseLeftButtonDown" Visibility="Collapsed" />-->
                </Grid>
            </controls:PivotItem>

            <!--Pivot item two-->
            <controls:PivotItem Header="{Binding Path=Strings.Mana, Source={StaticResource LocalizedStrings }}" Name="ManaPivot_Name">
                <!--Triple line list no text wrapping-->
                <ScrollViewer >

                    <Grid>

                        <Grid.RowDefinitions>
                            <RowDefinition Height="85*" />
                            <RowDefinition Height="85*" />
                            <RowDefinition Height="85*" />
                            <RowDefinition Height="85*" />
                            <RowDefinition Height="85*" />
                            <RowDefinition Height="85*" />
                            <RowDefinition Height="85*" />

                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="130"/>
                            <ColumnDefinition Width="100*"/>
                            <ColumnDefinition Width="132*" />
                            <ColumnDefinition Width="132*" />
                        </Grid.ColumnDefinitions>

                        <Image Source="Images\mana-black.png" Grid.Row="0" Grid.Column="0" Width="70" Height="70"/>
                        <Image Source="Images\mana-blue.png" Grid.Row="1" Grid.Column="0" Width="70" Height="70"/>
                        <Image Source="Images\mana-green.png" Grid.Row="2" Grid.Column="0" Width="70" Height="70"/>
                        <Image Source="Images\mana-red.png" Grid.Row="3" Grid.Column="0" Width="70" Height="70"/>
                        <Image Source="Images\mana-white.png" Grid.Row="4" Grid.Column="0" Width="70" Height="70"/>
                        <Image Source="Images\mana-colorless.png" Grid.Row="5" Grid.Column="0" Width="70" Height="70"/>
                        <TextBox FontSize="24" HorizontalAlignment="Center" Name="Mana6Text" Text="{Binding Path=Strings.Spells, Source={StaticResource LocalizedStrings }}" VerticalAlignment="Stretch" Width="130" TextAlignment="Center" Grid.Row="6" Grid.Column="0" InputScope="Text" LostFocus="Mana6Text_LostFocus" GotFocus="EnableIsHitTestVisible" KeyDown="CloseKeyboard"/>

                        <TextBox FontSize="24" HorizontalAlignment="Center" Name="Mana0Area" Text="0" VerticalAlignment="Stretch" Width="80" TextAlignment="Center" Grid.Row="0" Grid.Column="1" LostFocus="Mana0Area_LostFocus" GotFocus="EnableIsHitTestVisible" KeyDown="CloseKeyboard">
                            <TextBox.InputScope>
                                <InputScope>
                                    <InputScopeName NameValue="TelephoneNumber"/>
                                </InputScope>
                            </TextBox.InputScope>
                        </TextBox>
                        <TextBox FontSize="24" HorizontalAlignment="Center" Name="Mana1Area" Text="0" VerticalAlignment="Stretch" Width="80" TextAlignment="Center" Grid.Row="1" Grid.Column="1" LostFocus="Mana1Area_LostFocus" GotFocus="EnableIsHitTestVisible" KeyDown="CloseKeyboard">
                            <TextBox.InputScope>
                                <InputScope>
                                    <InputScopeName NameValue="TelephoneNumber"/>
                                </InputScope>
                            </TextBox.InputScope>
                        </TextBox>
                        <TextBox FontSize="24" HorizontalAlignment="Center" Name="Mana2Area" Text="0" VerticalAlignment="Stretch" Width="80" TextAlignment="Center" Grid.Row="2" Grid.Column="1" LostFocus="Mana2Area_LostFocus" GotFocus="EnableIsHitTestVisible" KeyDown="CloseKeyboard">
                            <TextBox.InputScope>
                                <InputScope>
                                    <InputScopeName NameValue="TelephoneNumber"/>
                                </InputScope>
                            </TextBox.InputScope>
                        </TextBox>
                        <TextBox FontSize="24" HorizontalAlignment="Center" Name="Mana3Area" Text="0" VerticalAlignment="Stretch" Width="80" TextAlignment="Center" Grid.Row="3" Grid.Column="1" LostFocus="Mana3Area_LostFocus" GotFocus="EnableIsHitTestVisible" KeyDown="CloseKeyboard">
                            <TextBox.InputScope>
                                <InputScope>
                                    <InputScopeName NameValue="TelephoneNumber"/>
                                </InputScope>
                            </TextBox.InputScope>
                        </TextBox>
                        <TextBox FontSize="24" HorizontalAlignment="Center" Name="Mana4Area" Text="0" VerticalAlignment="Stretch" Width="80" TextAlignment="Center" Grid.Row="4" Grid.Column="1" LostFocus="Mana4Area_LostFocus" GotFocus="EnableIsHitTestVisible" KeyDown="CloseKeyboard">
                            <TextBox.InputScope>
                                <InputScope>
                                    <InputScopeName NameValue="TelephoneNumber"/>
                                </InputScope>
                            </TextBox.InputScope>
                        </TextBox>
                        <TextBox FontSize="24" HorizontalAlignment="Center" Name="Mana5Area" Text="0" VerticalAlignment="Stretch" Width="80" TextAlignment="Center" Grid.Row="5" Grid.Column="1" LostFocus="Mana5Area_LostFocus" GotFocus="EnableIsHitTestVisible" KeyDown="CloseKeyboard">
                            <TextBox.InputScope>
                                <InputScope>
                                    <InputScopeName NameValue="TelephoneNumber"/>
                                </InputScope>
                            </TextBox.InputScope>
                        </TextBox>
                        <TextBox FontSize="24" HorizontalAlignment="Center" Name="Mana6Area" Text="0" VerticalAlignment="Stretch" Width="80" TextAlignment="Center" Grid.Row="6" Grid.Column="1" LostFocus="Mana6Area_LostFocus" GotFocus="EnableIsHitTestVisible" KeyDown="CloseKeyboard">
                            <TextBox.InputScope>
                                <InputScope>
                                    <InputScopeName NameValue="TelephoneNumber"/>
                                </InputScope>
                            </TextBox.InputScope>
                        </TextBox>

                        <Button Content="+ 1" Height="80" Name="Mana_Add0"  Click="Mana_Add0_Click" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="128" Grid.Row="0" Grid.Column="2" Grid.ColumnSpan="1" Grid.RowSpan="1"/>
                        <Button Content="+ 1" Height="80" Name="Mana_Add1"  Click="Mana_Add1_Click" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="128" Grid.Row="1" Grid.Column="2" Grid.ColumnSpan="1" Grid.RowSpan="1"/>
                        <Button Content="+ 1" Height="80" Name="Mana_Add2"  Click="Mana_Add2_Click" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="128" Grid.Row="2" Grid.Column="2" Grid.ColumnSpan="1" Grid.RowSpan="1"/>
                        <Button Content="+ 1" Height="80" Name="Mana_Add3"  Click="Mana_Add3_Click" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="128" Grid.Row="3" Grid.Column="2" Grid.ColumnSpan="1" Grid.RowSpan="1"/>
                        <Button Content="+ 1" Height="80" Name="Mana_Add4"  Click="Mana_Add4_Click" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="128" Grid.Row="4" Grid.Column="2" Grid.ColumnSpan="1" Grid.RowSpan="1"/>
                        <Button Content="+ 1" Height="80" Name="Mana_Add5"  Click="Mana_Add5_Click" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="128" Grid.Row="5" Grid.Column="2" Grid.ColumnSpan="1" Grid.RowSpan="1"/>
                        <Button Content="+ 1" Height="80" Name="Mana_Add6"  Click="Mana_Add6_Click" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="128" Grid.Row="6" Grid.Column="2" Grid.ColumnSpan="1" Grid.RowSpan="1"/>

                        <Button Content="- 1" Height="80" Name="Mana_Sub0"  Click="Mana_Sub0_Click" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="128" Grid.Row="0" Grid.Column="3" Grid.ColumnSpan="1" Grid.RowSpan="1"/>
                        <Button Content="- 1" Height="80" Name="Mana_Sub1"  Click="Mana_Sub1_Click" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="128" Grid.Row="1" Grid.Column="3" Grid.ColumnSpan="1" Grid.RowSpan="1"/>
                        <Button Content="- 1" Height="80" Name="Mana_Sub2"  Click="Mana_Sub2_Click" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="128" Grid.Row="2" Grid.Column="3" Grid.ColumnSpan="1" Grid.RowSpan="1"/>
                        <Button Content="- 1" Height="80" Name="Mana_Sub3"  Click="Mana_Sub3_Click" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="128" Grid.Row="3" Grid.Column="3" Grid.ColumnSpan="1" Grid.RowSpan="1"/>
                        <Button Content="- 1" Height="80" Name="Mana_Sub4"  Click="Mana_Sub4_Click" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="128" Grid.Row="4" Grid.Column="3" Grid.ColumnSpan="1" Grid.RowSpan="1"/>
                        <Button Content="- 1" Height="80" Name="Mana_Sub5"  Click="Mana_Sub5_Click" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="128" Grid.Row="5" Grid.Column="3" Grid.ColumnSpan="1" Grid.RowSpan="1"/>
                        <Button Content="- 1" Height="80" Name="Mana_Sub6"  Click="Mana_Sub6_Click" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="128" Grid.Row="6" Grid.Column="3" Grid.ColumnSpan="1" Grid.RowSpan="1"/>

                        <!--<toolbox:ToggleSwitch x:Name="FluxToggle" Header="Flux Capacitor"  Checked="ToggleSwitch_Checked" Unchecked="ToggleSwitch_Unchecked"  Grid.ColumnSpan="2"/>-->
                    </Grid>
                </ScrollViewer>
            </controls:PivotItem>



            <controls:PivotItem Name="HistoryPivot_Name" Header="{Binding Path=Strings.History, Source={StaticResource LocalizedStrings }}" >
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="70*" />
                        <ColumnDefinition Width="70*" />
                        <ColumnDefinition Width="70*" />
                        <ColumnDefinition Width="70*" />
                        <ColumnDefinition Width="140*" />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="50*" />
                        <RowDefinition Height="50*" />
                        <RowDefinition Height="340*" />
                        <RowDefinition Height="90*" />
                    </Grid.RowDefinitions>
                    <!--<phone:WebBrowser HorizontalAlignment="Left" Name="webBrowser_History" VerticalAlignment="Top" Height="424" Width="454" Visibility="Collapsed" />-->
                    <!--<ListBox Name="Lista" SelectionMode="Multiple" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Grid.Row="2" Grid.ColumnSpan="5" SelectionChanged="Lista_SelectionChanged">

                    </ListBox>-->


                    <ListBox x:Name="Lista" Margin="0,0,-12,0" ItemsSource="{Binding CurrentHistory}" SelectionChanged="Results_List_SelectionChanged" SelectionMode="Single" Grid.Row="2" Grid.ColumnSpan="5">
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <StackPanel Margin="0,0,0,17">
                                    <TextBlock Text="{Binding pv1}" TextWrapping="NoWrap" Margin="30,0,0,0" Style="{StaticResource PhoneTextNormalStyle}"/>
                                    <TextBlock Text="{Binding infect1}" TextWrapping="NoWrap" Margin="102,-27,0,0" Style="{StaticResource PhoneTextNormalStyle}" />
                                    <TextBlock Text="{Binding pv2}" TextWrapping="NoWrap" Margin="180,-27,0,0" Style="{StaticResource PhoneTextNormalStyle}" />
                                    <TextBlock Text="{Binding infect2}" TextWrapping="NoWrap" Margin="260,-27,0,0" Style="{StaticResource PhoneTextNormalStyle}" />
                                    <TextBlock Text="{Binding timespan}" TextWrapping="NoWrap" Margin="340,-27,0,0" Style="{StaticResource PhoneTextNormalStyle}" />
                                </StackPanel>
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>


                    <Button Content="{Binding Path=Strings.Save, Source={StaticResource LocalizedStrings }}" Height="80" Name="HistorySave_Button"  Click="HistorySave_Button_Click" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="228" Grid.Row="3" Grid.ColumnSpan="3"  />
                    <Button Content="{Binding Path=Strings.List, Source={StaticResource LocalizedStrings }}" Height="80" Name="HistoryLoad_Button"  Click="HistoryLoad_Button_Click" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="228" Grid.Row="3" Grid.Column="3" Grid.ColumnSpan="2"  />
                    <TextBlock Height="40" Width="140" Name="History_Player1_Name" Text="{Binding Path=Strings.Player_1, Source={StaticResource LocalizedStrings }}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" TextAlignment="Center" Grid.ColumnSpan="2" Margin="6,4" />
                    <TextBlock Height="40" Width="140" Name="History_Player2_Name" Text="{Binding Path=Strings.Player_2, Source={StaticResource LocalizedStrings }}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" TextAlignment="Center" Grid.Column="2" Grid.ColumnSpan="2"/>
                    <TextBlock Height="40" Width="140" Name="History_Timer_Name" Text="{Binding Path=Strings.Time, Source={StaticResource LocalizedStrings }}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" TextAlignment="Center" Grid.Column="4" Grid.RowSpan="2" />
                    <TextBlock Height="40" Width="70" Name="History_Player1_Life" Text="PV" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" TextAlignment="Center" Grid.Row="1" Grid.Column="0" />
                    <TextBlock Height="40" Width="70" Name="History_Player1_Center" Text="" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" TextAlignment="Center" Grid.Row="1" Grid.Column="1" />
                    <TextBlock Height="40" Width="70" Name="History_Player2_Life" Text="PV" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" TextAlignment="Center" Grid.Row="1" Grid.Column="2" />
                    <TextBlock Height="40" Width="70" Name="History_Player2_Center" Text="" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" TextAlignment="Center" Grid.Row="1" Grid.Column="3" />
                    <!--<Button Content="{Binding Path=Strings.CreateHistory, Source={StaticResource LocalizedStrings }}" Grid.ColumnSpan="5" Height="80" HorizontalAlignment="Stretch" Name="BuildHistory_Button" VerticalAlignment="Stretch" Width="240" Grid.Column="0" Grid.Row="2" Click="BuildHistory_Button_Click" />-->
                </Grid>

            </controls:PivotItem>

            <controls:PivotItem Name="SearchPivot_Name" Header="{Binding Path=Strings.Search, Source={StaticResource LocalizedStrings }}" >
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="250*" />
                        <ColumnDefinition Width="150*" />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="110*" />
                        <RowDefinition Height="50*" />
                        <RowDefinition Height="600*" />
                    </Grid.RowDefinitions>
                    <!--<phone:WebBrowser HorizontalAlignment="Left" Name="webBrowser_History" VerticalAlignment="Top" Height="424" Width="454" Visibility="Collapsed" />-->
                    <toolbox:PerformanceProgressBar Name="ToggleProgressBar" Grid.Row="1" Grid.ColumnSpan="2" Height="30" />
                    <!--<ListBox Name="Results_List" SelectionMode="Single" VerticalContentAlignment="Center" HorizontalContentAlignment="Left"  SelectionChanged="Results_List_SelectionChanged">

                    </ListBox>-->

                    <ListBox x:Name="Results_List" Margin="0,0,-12,0" ItemsSource="{Binding Cards}" SelectionChanged="Results_List_SelectionChanged" SelectionMode="Single" Grid.Row="2" Grid.ColumnSpan="2">
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <StackPanel Margin="0,0,0,17">
                                    <TextBlock Text="{Binding Name}" TextWrapping="NoWrap" Margin="12,0,0,0" Style="{StaticResource PhoneTextLargeStyle}"/>
                                    <TextBlock Text="{Binding Description}" TextWrapping="NoWrap" Margin="12,-6,0,0" Style="{StaticResource PhoneTextSubtleStyle}"/>
                                </StackPanel>
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>


                    <TextBox Height="70" HorizontalAlignment="Stretch" Name="Search_Text_Area" Text="" VerticalAlignment="Stretch" Width="290"  Grid.RowSpan="1" KeyDown="Search_Text_Area_KeyDown" />
                    <Button Content="{Binding Path=Strings.Search, Source={StaticResource LocalizedStrings }}" Grid.Column="1" Grid.RowSpan="1" Height="72" HorizontalAlignment="Stretch" Name="Search_Button" VerticalAlignment="Stretch" Width="150" Click="Search_Button_Click" />
                </Grid>

            </controls:PivotItem>

            <controls:PivotItem Name="GuidePivot_Name" Header="{Binding Path=Strings.Helps, Source={StaticResource LocalizedStrings }}" >
                <Grid>

                    <!--<phone:WebBrowser HorizontalAlignment="Left" Name="webBrowser_History" VerticalAlignment="Top" Height="424" Width="454" Visibility="Collapsed" />-->
                    <ListBox Name="Helps_List" SelectionMode="Single" VerticalContentAlignment="Center" HorizontalContentAlignment="Left" Grid.Row="0" Grid.ColumnSpan="5" SelectionChanged="Helps_List_SelectionChanged">

                    </ListBox>

                </Grid>

            </controls:PivotItem>


        </controls:Pivot>


        <!--ContentPanel - place additional content here-->

        <!--<google:BannerAd Margin="12,669,-31,0"
            xmlns:google="clr-namespace:Google.AdMob.Ads.WindowsPhone7.WPF;assembly=Google.AdMob.Ads.WindowsPhone7"
            AdUnitID="a14d8ce18b82e46" Grid.RowSpan="2" />-->

        <Grid Name="AdControlGrid" xmlns:adctl="clr-namespace:Microsoft.Advertising.Mobile.UI;assembly=Microsoft.Advertising.Mobile.UI" Grid.Row="1">
            <adctl:AdControl Name="AdControl" Height="80" Width="480" AdUnitId="32126" ApplicationId="b76d31a7-58ed-4379-bf66-a32f00905f2d" AdModel="Contextual" />
        </Grid>


    </Grid>

    <!--Sample code showing usage of ApplicationBar-->
    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar >
            <shell:ApplicationBar.MenuItems>
                <!--<shell:ApplicationBarMenuItem Text="MenuItem 1"/>
                <shell:ApplicationBarMenuItem Text="MenuItem 2"/>-->
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>

</phone:PhoneApplicationPage>